<?php
namespace app\admin\controller;

use think\App;
use think\facade\View;
use think\facade\Db;

class Kefucategory extends BaseController
{
    public function lists()
    {
        $list = Db::name('kefu_category')
            ->select();
        foreach($list as $val){
            echo $val['category_id'] . ' ';
            echo $val['category_name'] . ' ';
            echo '</br>';
        }
    }

    public function add()
    {
        $data = [
            'category_name' => '售后',
            'site_id' => 1,
            'create_time' => time(),
        ];
        $res = Db::name('kefu_category')->save($data);
        dump($data);
        dump($res);
    }
}
